<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>fluidOut</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="fluidNote.html" title="fluidNote" />
    <link rel="next" href="fluidProgramSelect.html" title="fluidProgramSelect" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">fluidOut</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="fluidNote.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="fluidProgramSelect.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="fluidOut"></a>
      <div class="titlepage"></div>
      <a id="IndexFluidOut" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">fluidOut</span>
        </h2>
        <p>fluidOut — 
      Outputs sound from a given fluidEngine
           </p>
      </div>
      <div class="refsect1">
        <a id="idp108873536"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">aleft, aright <span class="command"><strong>fluidOut</strong></span> ienginenum</pre>
      </div>
      <div class="refsect1">
        <a id="idp108875680"></a>
        <h2>Description</h2>
        <p>Outputs the sound from a fluidEngine.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108877024"></a>
        <h2>Initialization</h2>
        <p><span class="emphasis"><em>ienginenum </em></span> -- engine number assigned from
fluidEngine</p>
      </div>
      <div class="refsect1">
        <a id="idp108878688"></a>
        <h2>Performance</h2>
        <p><span class="emphasis"><em>aleft</em></span> -- Left channel audio output.</p>
        <p><span class="emphasis"><em>aright</em></span> -- Right channel audio output.</p>
        <p>Invoke fluidOut in an instrument definition numbered higher than any
    fluidcontrol instrument definitions. All SoundFonts used in the fluidEngine
    numbered <span class="emphasis"><em>ienginenum</em></span> send their audio output
    to this one opcode. Send a note with an indefinite duration to this
    instrument to turn the SoundFonts on for as long as required.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108882352"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the fluidOut opcode with two fluidOuts. It uses the file <a class="ulink" href="examples/fluidOut.csd" target="_top"><em class="citetitle">fluidOut.csd</em>,  <em class="citetitle">01hpschd.sf2</em> and </a><a class="ulink" href="examples/22Bassoon.sf2" target="_top"><em class="citetitle">22Bassoon.sf2</em></a>.
      </p>
        <div class="example">
          <a id="idp108885888"></a>
          <p class="title">
            <strong>Example 293. Example of the fluidOut opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac   -+rtmidi=virtual  -M0    <span class="comment">;;;realtime audio out and realtime midi in</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">;-o fluidOut.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span> <span class="op">=</span> 1

giengine1 <span class="opc">fluidEngine</span>
<span class="comment">; soundfont path to manual/examples</span>
isfnum1	 <span class="opc">fluidLoad</span> "01hpschd.sf2", giengine1, 1
	 <span class="opc">fluidProgramSelect</span> giengine1, 1, isfnum1, 0, 0

giengine2 <span class="opc">fluidEngine</span>
<span class="comment">; soundfont path to manual/examples</span>
isfnum2	 <span class="opc">fluidLoad</span> "22Bassoon.sf2", giengine2, 1
	 <span class="opc">fluidProgramSelect</span> giengine2, 1, isfnum2, 0, 70

<span class="oblock">instr</span> 1

	<span class="opc">mididefault</span>   60, p3
	<span class="opc">midinoteonkey</span> p4, p5
ikey	<span class="opc">init</span> p4
ivel	<span class="opc">init</span> p5
	<span class="opc">fluidNote</span> giengine1, 1, ikey, ivel

<span class="oblock">endin</span>

<span class="oblock">instr</span> 2

	<span class="opc">mididefault</span>   60, p3
	<span class="opc">midinoteonkey</span> p4, p5
ikey	<span class="opc">init</span> p4
ivel	<span class="opc">init</span> p5
	<span class="opc">fluidNote</span> giengine2, 1, ikey, ivel

<span class="oblock">endin</span>

<span class="oblock">instr</span> 98

imvol  <span class="opc">init</span> 7
asigl, asigr <span class="opc">fluidOut</span> giengine1
       <span class="opc">outs</span> asigl<span class="op">*</span>imvol, asigr<span class="op">*</span>imvol
<span class="oblock">endin</span>

<span class="oblock">instr</span> 99

imvol <span class="opc">init</span> 4
asigl, asigr <span class="opc">fluidOut</span> giengine2		 <span class="comment">;add a stereo flanger</span>
adelL <span class="opc">linseg</span> 0, p3<span class="op">*</span>.5, 0.02, p3<span class="op">*</span>.5, 0	 <span class="comment">;max delay time =20ms</span>
adelR <span class="opc">linseg</span> 0.02, p3<span class="op">*</span>.5, 0, p3<span class="op">*</span>.5, 0.02 <span class="comment">;max delay time =20ms		</span>
asigL <span class="opc">flanger</span> asigl, adelL, .6
asigR <span class="opc">flanger</span> asigr, adelR, .6
      <span class="opc">outs</span> asigL<span class="op">*</span>imvol, asigR<span class="op">*</span>imvol
<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span> 1 0 2 60 100 <span class="comment">;play one note of instr 1</span>
<span class="stamnt">i</span> 2 2 2 60 100 <span class="comment">;play another note of instr 2 and...</span>
<span class="stamnt">i</span> 98 0 60      <span class="comment">;play virtual keyboard for 60 sec.</span>
<span class="stamnt">i</span> 99 0 60
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
The output should include lines like these:
      </p>
        <pre class="screen">
chnl 1 using instr 1
chnl 2 using instr 2

SoundFont:   1  Bank:   0  Preset:   0  Harpsichord I-8
SoundFont:   1  Bank:   0  Preset:  70  Ethan Bassoon mono
      </pre>
        <p>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108891440"></a>
        <h2>See Also</h2>
        <p><a class="link" href="fluidEngine.html" title="fluidEngine"><em class="citetitle">fluidEngine</em></a>, <a class="link" href="fluidNote.html" title="fluidNote"><em class="citetitle">fluidNote</em></a>, <a class="link" href="fluidLoad.html" title="fluidLoad"><em class="citetitle">fluidLoad</em></a></p>
        <p> More information on soundfonts in the Floss Manuals: <a class="ulink" href="http://en.flossmanuals.net/csound/ch048_d-reading-midi-files" target="_top"><em class="citetitle">http://en.flossmanuals.net/csound/ch048_d-reading-midi-files</em></a></p>
        <p> Other information on soundfonts on Wikipedia: <a class="ulink" href="http://en.wikipedia.org/wiki/Soundfont" target="_top"><em class="citetitle">http://en.wikipedia.org/wiki/Soundfont</em></a></p>
      </div>
      <div class="refsect1">
        <a id="idp108897520"></a>
        <h2>Credits</h2>
        <p>Michael Gogins (gogins at pipeline dot com), Steven Yi. 
    Thanks to Peter Hanappe for Fluidsynth.</p>
      </div>
      <p>New in Csound5.00</p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="fluidNote.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="fluidProgramSelect.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">fluidNote </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> fluidProgramSelect</td>
        </tr>
      </table>
    </div>
  </body>
</html>
